/*    */ package com.umeng.common.util;
/*    */ 
/*    */ import java.io.ByteArrayOutputStream;
/*    */ import java.io.IOException;
/*    */ import java.io.UnsupportedEncodingException;
/*    */ import java.util.zip.DataFormatException;
/*    */ import java.util.zip.Deflater;
/*    */ import java.util.zip.Inflater;
/*    */ 
/*    */ public class f
/*    */ {
/*    */   public static int a;
/*    */ 
/*    */   public static byte[] a(String paramString1, String paramString2)
/*    */     throws IOException
/*    */   {
/* 27 */     if (h.d(paramString1)) return null;
/* 28 */     Deflater localDeflater = new Deflater();
/* 29 */     localDeflater.setInput(paramString1.getBytes(paramString2));
/* 30 */     localDeflater.finish();
/*    */ 
/* 32 */     byte[] arrayOfByte1 = new byte[8192];
/* 33 */     a = 0;
/* 34 */     ByteArrayOutputStream localByteArrayOutputStream = null;
/*    */     try {
/* 36 */       localByteArrayOutputStream = new ByteArrayOutputStream();
/* 37 */       while (!localDeflater.finished()) {
/* 38 */         int i = localDeflater.deflate(arrayOfByte1);
/* 39 */         a += i;
/* 40 */         localByteArrayOutputStream.write(arrayOfByte1, 0, i);
/*    */       }
/* 42 */       localDeflater.end();
/*    */     } finally {
/* 44 */       if (localByteArrayOutputStream != null) localByteArrayOutputStream.close();
/*    */     }
/* 46 */     byte[] arrayOfByte2 = localByteArrayOutputStream.toByteArray();
/* 47 */     return arrayOfByte2;
/*    */   }
/*    */ 
/*    */   public static String a(byte[] paramArrayOfByte, String paramString)
/*    */     throws UnsupportedEncodingException, DataFormatException
/*    */   {
/* 60 */     if ((paramArrayOfByte == null) || (paramArrayOfByte.length == 0)) return null;
/* 61 */     Inflater localInflater = new Inflater();
/* 62 */     byte[] arrayOfByte = new byte[100];
/* 63 */     localInflater.setInput(paramArrayOfByte, 0, paramArrayOfByte.length);
/* 64 */     StringBuilder localStringBuilder = new StringBuilder();
/* 65 */     int i = 0;
/* 66 */     while (!localInflater.needsInput()) {
/* 67 */       i = localInflater.inflate(arrayOfByte);
/* 68 */       localStringBuilder.append(new String(arrayOfByte, 0, i, paramString));
/*    */     }
/* 70 */     localInflater.end();
/* 71 */     return localStringBuilder.toString();
/*    */   }
/*    */ }

/* Location:           C:\Users\Administrator\Desktop\umeng_sdk.jar
 * Qualified Name:     com.umeng.common.util.f
 * JD-Core Version:    0.6.2
 */